package com.wans.order.feign;

import com.wans.order.feign.fallback.ProductFeignFallback;
import com.wans.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//@FeignClient(name = "server-product")
@FeignClient(value = "server-product",fallback = ProductFeignFallback.class)  // openfeign 默认使用服务名进行调用
public interface ProductFeignClient {

    @GetMapping("/product/getProduct/{id}")
    Product getProduct(@PathVariable("id") Long id);

}
